﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TXTD.Admin.Data.Entitys;
using TXTD.Admin.Data.Entitys.System;

namespace TXTD.Admin.Data.EntityConfiguration.System
{
    public class SysUserEntityTypeConfiguration : IEntityTypeConfiguration<SysUser>
    {
        public void Configure(EntityTypeBuilder<SysUser> builder)
        {
            //主键
            builder.HasKey(e => e.UserId);
            
            builder.Property(e => e.UserId).HasMaxLength(32).IsUnicode(true);
            builder.Property(e => e.UserCode).HasMaxLength(200).IsUnicode(true);
            builder.Property(e => e.UserName).HasMaxLength(500).IsUnicode(true);
            builder.Property(e => e.RealName).HasMaxLength(500).IsUnicode(true);
            builder.Property(e => e.EmailAddress).HasMaxLength(100).IsUnicode(true);
            builder.Property(e => e.MobileNumber).HasMaxLength(30).IsUnicode(true);
            builder.Property(e => e.PasswordKey).HasMaxLength(50).IsUnicode(true);
            builder.Property(e => e.Password).HasMaxLength(50).IsUnicode(true);

            builder.Property(e => e.UpdatedBy).HasMaxLength(32).IsUnicode(true);
            builder.Property(e => e.UpdatedBy).HasMaxLength(32).IsUnicode(true);
        }
    }
}
